package com.gy.niuer.mapper;
import org.apache.ibatis.annotations.Param;
import com.gy.niuer.domain.Patient;
import org.apache.ibatis.annotations.*;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gy.niuer.domain.Appointment;

import java.util.List;

/**
* @Entity com.gy.niuer.domain.Appointment
*/
@Mapper
public interface AppointmentMapper extends BaseMapper<Appointment> {

    int addAll(Appointment appointment);

    Appointment selectOneByPatient(@Param("patient") int patient);

    @Insert("insert into appointment (patient,doctor,time,num,clinic,fees) " +
            "values (#{patient.id},#{doctor.id},#{time},#{num},#{clinic.id},#{clinic.fees})")
    boolean addAppoint(Appointment appointment);

    int deleteByPatient(@Param("patient") int patient);

    int deleteById(@Param("id") Integer id);

    List<Appointment> selectAllById(@Param("id") Integer id);


    List<Appointment> selectAllByPatient(@Param("patient") int patient);
}
